<?php

namespace app\models\constant;

trait Status
{
    /**
     * status list
     * @var int[]
     */
    public static $statusMapping = [
        'ALL'       => -1,
        'OK'        => 1,
        'CLOSE'     => 0,
        'DELETE'    => -99,
    ];

    /**
     * status display list
     * @var int[]
     */
    public static $statusMappingDisplay = [
        '全部'       => -1,
        '正常'       => 1,
        '关闭'       => 0,
        // '删除'       => -99,
    ];

    /**
     * Status list
     *
     * @return array
     */
    public static function statusList()
    {
        $list = [];
        foreach (self::$statusMappingDisplay as $key => $value) {
            $list[] = [
                'label' => $key,
                'value' => $value
            ];
        }

        return $list;
    }
}